import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/index/Index.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      meta:{
        sort:1
      },
      children:[
        {
          path:'/statistic',  //统计页面
          name:'statistic',
          component: () => import('./views/statistic/Statistic.vue'),
          meta: {
            title: '卡券统计',
            sort:2
          }
        },
        {
          path:'/edit/:doing',   //doing=add  doing=edit
          name:'edit',
          component: () => import('./views/edit/Edit.vue'),
          meta: {
            title: '编辑门店',
            sort:2
          }
        },
        {
          path:'/transfer',  //转让店长
          name:'transfer',
          component: () => import('./views/transfer/Transfer.vue'),
          meta: {
            title: '转让店长',
            sort:2
          }
        },
        {
          path:'/staff',  //员工管理
          name:'staff',
          component: () => import('./views/staff/Staff.vue'),
          meta: {
            title: '员工管理',
            sort:2
          }
        }
      ]
    },
    {
      path:'/position',  //职位管理
      name:'position',
      component: () => import('./views/position/Position.vue'),
      meta: {
        title: '职位管理',
        sort:3
      }
    },
    {
      path:'/coupon/:select/:activity_id',  //卡券管理
      name:'coupon',
      component: () => import('./views/coupon/Coupon.vue'),
      meta: {
        title: '卡券管理',
        sort:3
      }
    },
    {
      path:'/edit-coupon/:doing/:coupon_id',  //编辑卡券
      name:'edit-coupon',
      component: () => import('./views/edit_coupon/EditCoupon.vue'),
      meta: {
        title: '编辑卡券',
        sort:4
      }
    },
    {
      path:'/activity',  //活动列表
      name:'activity',
      component: () => import('./views/activity/Activity.vue'),
      meta: {
        title: '投放活动列表',
        sort:2
      }
    },
    {
      path:'/putin/:coupon_id/:activity_id',  //给指定活动投放卡券 coupon_id 卡券id  activity_id 活动id
      name:'putin',
      component: () => import('./views/putin/Putin.vue'),
      meta: {
        title: '投放卡券',
        sort:5
      }
    }
  ]
})
